function create_updated_collection(collectionA, objectB) {
  let collection=collectionA;
  for (let i=0;i<collectionA.length;i++)
  {  
    for (let j=0;j<objectB["value"].length;j++)
    {
      if (collectionA[i]["key"]==objectB["value"][j])
        {
          collection[i]={"key": collectionA[i]["key"],"count": collectionA[i]["count"]-1};
        }
    }
  }
  return collection;
}

module.exports = create_updated_collection;
